<?php use_helper('I18N', 'Date') ?>
<?php include_partial('book/assets') ?>

<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<!-- Grid row -->
<div id="sf_admin_container" class="row-fluid">

    <!-- Data block -->
    <article class="span12 data-block nested">
        <div class="data-container">
            <header>
                <h2><?php echo __('New Book', array(), 'messages') ?></h2>
            </header>


            <div id="sf_admin_header">
                <?php include_partial('book/form_header', array('book' => $book, 'form' => $form, 'configuration' => $configuration)) ?>
            </div>

            <section class="tab-content">
                <?php include_partial('book/flashes') ?>
                <?php //include_partial('book/form', array('book' => $book, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?>

                <?php echo form_tag_for($form, '@book', array('class' => 'form-inline')) ?>
                <?php echo $form->renderHiddenFields(false) ?>

                <?php if ($form->hasGlobalErrors()): ?>
                <?php echo $form->renderGlobalErrors() ?>
                <?php endif; ?>

                <div class="row-fluid">
                    <div class="span8 data-block">
                        <fieldset>
                            <!--<legend>Үндсэн мэдээлэл</legend>-->
                            <?php include_partial('book/field',array('form'=>$form,'name'=>'title'));?>
                            <?php include_partial('book/field',array('form'=>$form,'name'=>'introduction'));?>
                        </fieldset>
                        <br/>
                        <div class="row-fluid">
                            <fieldset class="span6 data-block">
                                <!--<legend>Үндсэн мэдээлэл</legend>-->
                                <?php include_partial('book/field',array('form'=>$form,'name'=>'meta'));?>
                                <?php include_partial('book/field',array('form'=>$form,'name'=>'tag'));?>
                            </fieldset>
                            <fieldset class="span6 data-block">
                                <!--<legend>Үндсэн мэдээлэл</legend>-->
                                <?php include_partial('book/field',array('form'=>$form,'name'=>'published_year'));?>
                                <?php include_partial('book/field',array('form'=>$form,'name'=>'page_count'));?>
                            </fieldset>
                        </div>
                    </div>
                    <div class="span4 data-block">
                        <fieldset>
                            <!--<legend>Нэмэлт мэдээлэл</legend>-->
                            <?php include_partial('book/field',array('form'=>$form,'name'=>'category_id'));?>
                            <?php include_partial('book/field',array('form'=>$form,'name'=>'author_id'));?>
                        </fieldset>
                        <br/>
                        <fieldset>
                            <!--<legend>Нэмэлт мэдээлэл</legend>-->
                            <?php include_partial('book/field',array('form'=>$form,'name'=>'cover'));?>
                        </fieldset>
                        <br/>
                        <fieldset>
                            <!--<legend>Нэмэлт мэдээлэл</legend>-->
                            <?php include_partial('book/field',array('form'=>$form,'name'=>'isbn_code'));?>
                            <?php include_partial('book/field',array('form'=>$form,'name'=>'language'));?>
                        </fieldset>
                    </div>
                </div>

                <?php include_partial('book/form_actions', array('book' => $book, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?>
                </form>
            </section>

            <div id="sf_admin_footer">
                <?php include_partial('book/form_footer', array('book' => $book, 'form' => $form, 'configuration' => $configuration)) ?>
            </div>
        </div>
    </article>
</div>
